const dns = require('dns');
let domain = 'baidu.com';
dns.lookup(domain, function(err, address) {
    if (err) {
        console.log(err);
        return;
    }
    console.log(address);
});

/**
 * 域名解析，返回一个ip
 * 110.242.68.66
 */